home *** CD-ROM | disk | FTP | other *** search
/ Developer CD Series 1995 August: Tool Chest / Dev.CD Aug 95 TC / Dev.CD Aug 95 TC.toast / Tool Chest / Interfaces / UniversalInterfaces 2.1B1 / AIncludes / CMApplication.a < prev    next >
Encoding:
Text File  |  1995-04-18  |  35.1 KB  |  1,560 lines  |  [TEXT/MPS ]

  1. ;
  2. ;    File:        CMApplication.a
  3. ;
  4. ;    Contains:    Color Matching Interfaces
  5. ;
  6. ;    Version:    Technology:    ColorSync 2.0
  7. ;                Package:    Universal Interfaces 2.1ß1 in “MPW Prerelease” on ETO #17
  8. ;
  9. ;    Copyright:    © 1984-1995 by Apple Computer, Inc.
  10. ;                All rights reserved.
  11. ;
  12. ;    Bugs?:        If you find a problem with this file, use the Apple Bug Reporter
  13. ;                stack.  Include the file and version information (from above)
  14. ;                in the problem description and send to:
  15. ;                    Internet:    apple.bugs@applelink.apple.com
  16. ;                    AppleLink:    APPLE.BUGS
  17. ;
  18. ;
  19.  
  20.     IF &TYPE('__CMAPPLICATION__') = 'UNDEFINED' THEN
  21. __CMAPPLICATION__ SET 1
  22.  
  23.  
  24.     IF &TYPE('__TYPES__') = 'UNDEFINED' THEN
  25.     include 'Types.a'
  26.     ENDIF
  27. ;        include 'ConditionalMacros.a'                                ;
  28.  
  29.     IF &TYPE('__QUICKDRAW__') = 'UNDEFINED' THEN
  30.     include 'Quickdraw.a'
  31.     ENDIF
  32. ;        include 'MixedMode.a'                                        ;
  33. ;        include 'QuickdrawText.a'                                    ;
  34.  
  35.     IF &TYPE('__FILES__') = 'UNDEFINED' THEN
  36.     include 'Files.a'
  37.     ENDIF
  38. ;        include 'OSUtils.a'                                        ;
  39. ;            include 'Memory.a'                                        ;
  40.  
  41.     IF &TYPE('__PRINTING__') = 'UNDEFINED' THEN
  42.     include 'Printing.a'
  43.     ENDIF
  44. ;        include 'Errors.a'                                            ;
  45. ;        include 'Dialogs.a'                                        ;
  46. ;            include 'Windows.a'                                    ;
  47. ;                include 'Events.a'                                    ;
  48. ;                include 'Controls.a'                                ;
  49. ;                    include 'Menus.a'                                ;
  50. ;            include 'TextEdit.a'                                    ;
  51.  
  52.     IF &TYPE('__CMICCPROFILE__') = 'UNDEFINED' THEN
  53.     include 'CMICCProfile.a'
  54.     ENDIF
  55.  
  56. gestaltColorSync20                EQU        $0200
  57.  
  58. kDefaultCMMSignature            EQU        'appl'
  59.  
  60. ; Macintosh 68K trap word 
  61. cmTrap                            EQU        $ABEE
  62.  
  63. ; PicComment IDs 
  64. cmBeginProfile                    EQU        220
  65. cmEndProfile                    EQU        221
  66. cmEnableMatching                EQU        222
  67. cmDisableMatching                EQU        223
  68. cmComment                        EQU        224
  69.  
  70. ; PicComment selectors for cmComment 
  71. cmBeginProfileSel                EQU        0
  72. cmContinueProfileSel            EQU        1
  73. cmEndProfileSel                    EQU        2
  74.  
  75. ; Defines for version 1.0 CMProfileSearchRecord.fieldMask 
  76. cmMatchCMMType                    EQU        $00000001
  77. cmMatchApplProfileVersion        EQU        $00000002
  78. cmMatchDataType                    EQU        $00000004
  79. cmMatchDeviceType                EQU        $00000008
  80. cmMatchDeviceManufacturer        EQU        $00000010
  81. cmMatchDeviceModel                EQU        $00000020
  82. cmMatchDeviceAttributes            EQU        $00000040
  83. cmMatchFlags                    EQU        $00000080
  84. cmMatchOptions                    EQU        $00000100
  85. cmMatchWhite                    EQU        $00000200
  86. cmMatchBlack                    EQU        $00000400
  87.  
  88. ; Defines for version 2.0 CMSearchRecord.searchMask 
  89. cmMatchAnyProfile                EQU        $00000000
  90. cmMatchProfileCMMType            EQU        $00000001
  91. cmMatchProfileClass                EQU        $00000002
  92. cmMatchDataColorSpace            EQU        $00000004
  93. cmMatchProfileConnectionSpace    EQU        $00000008
  94. cmMatchManufacturer                EQU        $00000010
  95. cmMatchModel                    EQU        $00000020
  96. cmMatchAttributes                EQU        $00000040
  97. cmMatchProfileFlags                EQU        $00000080
  98.  
  99. ; Result codes 
  100. ; General Errors 
  101. cmProfileError                    EQU        -170
  102. cmMethodError                    EQU        -171
  103. cmMethodNotFound                EQU        -175                ; CMM not present 
  104. cmProfileNotFound                EQU        -176                ; Responder error 
  105. cmProfilesIdentical                EQU        -177                ; Profiles the same 
  106. cmCantConcatenateError            EQU        -178                ; Profile can't be concatenated 
  107. cmCantXYZ                        EQU        -179                ; CMM cant handle XYZ space 
  108. cmCantDeleteProfile                EQU        -180                ; Responder error 
  109. cmUnsupportedDataType            EQU        -181                ; Responder error 
  110. cmNoCurrentProfile                EQU        -182                ; Responder error 
  111. ; Profile Access Errors 
  112. cmElementTagNotFound            EQU        -4200
  113. cmIndexRangeErr                    EQU        -4201                ; Index out of range 
  114. cmCantDeleteElement                EQU        -4202
  115. cmFatalProfileErr                EQU        -4203
  116. cmInvalidProfile                EQU        -4204                ; A Profile must contain a 'cs1 ' tag to be valid 
  117. cmInvalidProfileLocation        EQU        -4205                ; Operation not supported for this profile location 
  118. ; Profile Search Errors 
  119. cmInvalidSearch                    EQU        -4206                ; Bad Search Handle 
  120. cmSearchError                    EQU        -4207
  121. cmErrIncompatibleProfile        EQU        -4208
  122. ; Other ColorSync Errors 
  123. cmInvalidColorSpace                EQU        -4209                ; Profile colorspace does not match bitmap type 
  124. cmInvalidSrcMap                    EQU        -4210                ; Source pix/bit map was invalid 
  125. cmInvalidDstMap                    EQU        -4211                ; Destination pix/bit map was invalid 
  126. cmNoGDevicesError                EQU        -4212                ; Begin/End Matching -- no gdevices available 
  127. cmInvalidProfileComment            EQU        -4213                ; Bad Profile comment during drawpicture 
  128. ; Color Conversion Errors 
  129. cmRangeOverFlow                    EQU        -4214                ; One or more output color value overflows in color conversion 
  130. ;                                                        all input color values will still be converted, and the overflown 
  131. ;                                                        will be clipped 
  132. ; Other Profile Access Errors 
  133. cmCantCopyModifiedV1Profile        EQU        -4215                ; It is illegal to copy version 1 profiles that  
  134. ;                                                        have been modified 
  135.  
  136. ; deviceType values for ColorSync 1.0 Device Profile access 
  137. cmSystemDevice                    EQU        'sys '
  138. cmGDevice                        EQU        'gdev'
  139.  
  140. ; Commands for CMFlattenUPP(…) 
  141. cmOpenReadSpool                    EQU        1
  142. cmOpenWriteSpool                EQU        2
  143. cmReadSpool                        EQU        3
  144. cmWriteSpool                    EQU        4
  145. cmCloseSpool                    EQU        5
  146.  
  147. ; Flags for PostScript-related functions 
  148. cmPS7bit                        EQU        1
  149. cmPS8bit                        EQU        2
  150.  
  151. ; Caller-supplied progress function for Bitmap & PixMap matching routines 
  152. ; Caller-supplied filter function for Profile search 
  153. ; typedef long                 CMError
  154. ; For 1.0 and 2.0 profile header variants 
  155. ; CMAppleProfileHeader 
  156. CMAppleProfileHeader     RECORD    0
  157. cm1                         ds     CMHeader ; offset: $0 (0)
  158.                          ORG 0
  159. cm2                         ds     CM2Header ; offset: $0 (0)
  160.                          ORG 128
  161. sizeof                     EQU *            ; size:   $80 (128)
  162.                         ENDR
  163.  
  164. ; typedef union CMAppleProfileHeader  CMAppleProfileHeader
  165. ; Param for CWConcatColorWorld(…) 
  166. CMConcatProfileSet         RECORD    0
  167. keyIndex                 ds.w   1        ; offset: $0 (0)        ; Zero-based 
  168. count                     ds.w   1        ; offset: $2 (2)        ; Min 1 
  169. profileSet                 ds.l   1        ; offset: $4 (4)        ; Variable. Ordered from Source -> Dest 
  170. sizeof                     EQU *            ; size:   $8 (8)
  171.                         ENDR
  172.  
  173. ; typedef struct CMConcatProfileSet  CMConcatProfileSet
  174. ; ColorSync color data types 
  175. CMRGBColor                 RECORD    0
  176. red                         ds.w   1        ; offset: $0 (0)        ; 0..65535 
  177. green                     ds.w   1        ; offset: $2 (2)
  178. blue                     ds.w   1        ; offset: $4 (4)
  179. sizeof                     EQU *            ; size:   $6 (6)
  180.                         ENDR
  181.  
  182. ; typedef struct CMRGBColor  CMRGBColor
  183. CMCMYKColor             RECORD    0
  184. cyan                     ds.w   1        ; offset: $0 (0)        ; 0..65535 
  185. magenta                     ds.w   1        ; offset: $2 (2)
  186. yellow                     ds.w   1        ; offset: $4 (4)
  187. black                     ds.w   1        ; offset: $6 (6)
  188. sizeof                     EQU *            ; size:   $8 (8)
  189.                         ENDR
  190.  
  191. ; typedef struct CMCMYKColor  CMCMYKColor
  192. CMCMYColor                 RECORD    0
  193. cyan                     ds.w   1        ; offset: $0 (0)        ; 0..65535 
  194. magenta                     ds.w   1        ; offset: $2 (2)
  195. yellow                     ds.w   1        ; offset: $4 (4)
  196. sizeof                     EQU *            ; size:   $6 (6)
  197.                         ENDR
  198.  
  199. ; typedef struct CMCMYColor  CMCMYColor
  200. CMHLSColor                 RECORD    0
  201. hue                         ds.w   1        ; offset: $0 (0)        ; 0..65535. Fraction of circle. Red at 0 
  202. lightness                 ds.w   1        ; offset: $2 (2)        ; 0..65535 
  203. saturation                 ds.w   1        ; offset: $4 (4)        ; 0..65535 
  204. sizeof                     EQU *            ; size:   $6 (6)
  205.                         ENDR
  206.  
  207. ; typedef struct CMHLSColor  CMHLSColor
  208. CMHSVColor                 RECORD    0
  209. hue                         ds.w   1        ; offset: $0 (0)        ; 0..65535. Fraction of circle. Red at 0 
  210. saturation                 ds.w   1        ; offset: $2 (2)        ; 0..65535 
  211. value                     ds.w   1        ; offset: $4 (4)        ; 0..65535 
  212. sizeof                     EQU *            ; size:   $6 (6)
  213.                         ENDR
  214.  
  215. ; typedef struct CMHSVColor  CMHSVColor
  216. CMLabColor                 RECORD    0
  217. L                         ds.w   1        ; offset: $0 (0)        ; 0..65535 maps to 0..100 
  218. a                         ds.w   1        ; offset: $2 (2)        ; 0..65535 maps to -128..127.996 
  219. b                         ds.w   1        ; offset: $4 (4)        ; 0..65535 maps to -128..127.996 
  220. sizeof                     EQU *            ; size:   $6 (6)
  221.                         ENDR
  222.  
  223. ; typedef struct CMLabColor  CMLabColor
  224. CMLuvColor                 RECORD    0
  225. L                         ds.w   1        ; offset: $0 (0)        ; 0..65535 maps to 0..100 
  226. u                         ds.w   1        ; offset: $2 (2)        ; 0..65535 maps to -128..127.996 
  227. v                         ds.w   1        ; offset: $4 (4)        ; 0..65535 maps to -128..127.996 
  228. sizeof                     EQU *            ; size:   $6 (6)
  229.                         ENDR
  230.  
  231. ; typedef struct CMLuvColor  CMLuvColor
  232. CMYxyColor                 RECORD    0
  233. capY                     ds.w   1        ; offset: $0 (0)        ; 0..65535 maps to 0..1 
  234. x                         ds.w   1        ; offset: $2 (2)        ; 0..65535 maps to 0..1 
  235. y                         ds.w   1        ; offset: $4 (4)        ; 0..65535 maps to 0..1 
  236. sizeof                     EQU *            ; size:   $6 (6)
  237.                         ENDR
  238.  
  239. ; typedef struct CMYxyColor  CMYxyColor
  240. CMGrayColor             RECORD    0
  241. gray                     ds.w   1        ; offset: $0 (0)        ; 0..65535 
  242. sizeof                     EQU *            ; size:   $2 (2)
  243.                         ENDR
  244.  
  245. ; typedef struct CMGrayColor  CMGrayColor
  246. CMMultichannel5Color     RECORD    0
  247. components                 ds.b   5        ; offset: $0 (0)        ; 0..255 
  248.                          ORG 6
  249. sizeof                     EQU *            ; size:   $6 (6)
  250.                         ENDR
  251.  
  252. ; typedef struct CMMultichannel5Color  CMMultichannel5Color
  253. CMMultichannel6Color     RECORD    0
  254. components                 ds.b   6        ; offset: $0 (0)        ; 0..255 
  255. sizeof                     EQU *            ; size:   $6 (6)
  256.                         ENDR
  257.  
  258. ; typedef struct CMMultichannel6Color  CMMultichannel6Color
  259. CMMultichannel7Color     RECORD    0
  260. components                 ds.b   7        ; offset: $0 (0)        ; 0..255 
  261.                          ORG 8
  262. sizeof                     EQU *            ; size:   $8 (8)
  263.                         ENDR
  264.  
  265. ; typedef struct CMMultichannel7Color  CMMultichannel7Color
  266. CMMultichannel8Color     RECORD    0
  267. components                 ds.b   8        ; offset: $0 (0)        ; 0..255 
  268. sizeof                     EQU *            ; size:   $8 (8)
  269.                         ENDR
  270.  
  271. ; typedef struct CMMultichannel8Color  CMMultichannel8Color
  272. CMColor                 RECORD    0
  273. rgb                         ds     CMRGBColor ; offset: $0 (0)
  274.                          ORG 0
  275. hsv                         ds     CMHSVColor ; offset: $0 (0)
  276.                          ORG 0
  277. hls                         ds     CMHLSColor ; offset: $0 (0)
  278.                          ORG 0
  279. XYZ                         ds     CMXYZColor ; offset: $0 (0)
  280.                          ORG 0
  281. Lab                         ds     CMLabColor ; offset: $0 (0)
  282.                          ORG 0
  283. Luv                         ds     CMLuvColor ; offset: $0 (0)
  284.                          ORG 0
  285. Yxy                         ds     CMYxyColor ; offset: $0 (0)
  286.                          ORG 0
  287. cmyk                     ds     CMCMYKColor ; offset: $0 (0)
  288.                          ORG 0
  289. cmy                         ds     CMCMYColor ; offset: $0 (0)
  290.                          ORG 0
  291. gray                     ds     CMGrayColor ; offset: $0 (0)
  292.                          ORG 0
  293. mc5                         ds     CMMultichannel5Color ; offset: $0 (0)
  294.                          ORG 0
  295. mc6                         ds     CMMultichannel6Color ; offset: $0 (0)
  296.                          ORG 0
  297. mc7                         ds     CMMultichannel7Color ; offset: $0 (0)
  298.                          ORG 0
  299. mc8                         ds     CMMultichannel8Color ; offset: $0 (0)
  300.                          ORG 8
  301. sizeof                     EQU *            ; size:   $8 (8)
  302.                         ENDR
  303.  
  304. ; typedef union CMColor     CMColor
  305. CMProfileSearchRecord     RECORD    0
  306. header                     ds     CMHeader ; offset: $0 (0)
  307. fieldMask                 ds.l   1        ; offset: $40 (64)
  308. reserved                 ds.l   2        ; offset: $44 (68)
  309. sizeof                     EQU *            ; size:   $4C (76)
  310.                         ENDR
  311.  
  312. ; typedef struct CMProfileSearchRecord  CMProfileSearchRecord, **CMProfileSearchRecordHandle
  313. ; Search definition for 2.0 
  314. CMSearchRecord             RECORD    0
  315. CMMType                     ds.l   1        ; offset: $0 (0)
  316. profileClass             ds.l   1        ; offset: $4 (4)
  317. dataColorSpace             ds.l   1        ; offset: $8 (8)
  318. profileConnectionSpace     ds.l   1        ; offset: $C (12)
  319. deviceManufacturer         ds.l   1        ; offset: $10 (16)
  320. deviceModel                 ds.l   1        ; offset: $14 (20)
  321. deviceAttributes         ds.l   2        ; offset: $18 (24)
  322. profileFlags             ds.l   1        ; offset: $20 (32)
  323. searchMask                 ds.l   1        ; offset: $24 (36)
  324. filter                     ds.l   1        ; offset: $28 (40)
  325. sizeof                     EQU *            ; size:   $2C (44)
  326.                         ENDR
  327.  
  328. ; typedef struct CMSearchRecord  CMSearchRecord
  329. ; GetCWInfo structures 
  330. CMMInfoRecord             RECORD    0
  331. CMMType                     ds.l   1        ; offset: $0 (0)
  332. CMMVersion                 ds.l   1        ; offset: $4 (4)
  333. sizeof                     EQU *            ; size:   $8 (8)
  334.                         ENDR
  335.  
  336. ; typedef struct CMMInfoRecord  CMMInfoRecord
  337. CMCWInfoRecord             RECORD    0
  338. cmmCount                 ds.l   1        ; offset: $0 (0)
  339. cmmInfo                     ds.b   2 * CMMInfoRecord.sizeof ; offset: $4 (4)
  340. sizeof                     EQU *            ; size:   $14 (20)
  341.                         ENDR
  342.  
  343. ; typedef struct CMCWInfoRecord  CMCWInfoRecord
  344.  
  345. cmNoColorPacking                EQU        $0000
  346. cmAlphaSpace                    EQU        $0080
  347. cmWord5ColorPacking                EQU        $0500
  348. cmLong8ColorPacking                EQU        $0800
  349. cmLong10ColorPacking            EQU        $0a00
  350. cmAlphaFirstPacking                EQU        $1000
  351. cmOneBitDirectPacking            EQU        $0b00
  352.  
  353. cmNoSpace                        EQU        0
  354. cmRGBSpace                        EQU        1
  355. cmCMYKSpace                        EQU        2
  356. cmHSVSpace                        EQU        3
  357. cmHLSSpace                        EQU        4
  358. cmYXYSpace                        EQU        5
  359. cmXYZSpace                        EQU        6
  360. cmLUVSpace                        EQU        7
  361. cmLABSpace                        EQU        8
  362. cmReservedSpace1                EQU        9
  363. cmGraySpace                        EQU        10
  364. cmReservedSpace2                EQU        11
  365. cmGamutResultSpace                EQU        12
  366. cmRGBASpace                        EQU        cmRGBSpace + cmAlphaSpace
  367. cmGrayASpace                    EQU        cmGraySpace + cmAlphaSpace
  368. cmRGB16Space                    EQU        cmWord5ColorPacking + cmRGBSpace
  369. cmRGB32Space                    EQU        cmLong8ColorPacking + cmRGBSpace
  370. cmARGB32Space                    EQU        cmLong8ColorPacking + cmAlphaFirstPacking + cmRGBASpace
  371. cmCMYK32Space                    EQU        cmLong8ColorPacking + cmCMYKSpace
  372. cmHSV32Space                    EQU        cmLong10ColorPacking + cmHSVSpace
  373. cmHLS32Space                    EQU        cmLong10ColorPacking + cmHLSSpace
  374. cmYXY32Space                    EQU        cmLong10ColorPacking + cmYXYSpace
  375. cmXYZ32Space                    EQU        cmLong10ColorPacking + cmXYZSpace
  376. cmLUV32Space                    EQU        cmLong10ColorPacking + cmLUVSpace
  377. cmLAB32Space                    EQU        cmLong10ColorPacking + cmLABSpace
  378. cmGamutResult1Space                EQU        cmOneBitDirectPacking + cmGamutResultSpace
  379.  
  380. ; typedef unsigned long     CMBitmapColorSpace
  381. CMBitmap                 RECORD    0
  382. image                     ds.l   1        ; offset: $0 (0)
  383. width                     ds.l   1        ; offset: $4 (4)
  384. height                     ds.l   1        ; offset: $8 (8)
  385. rowBytes                 ds.l   1        ; offset: $C (12)
  386. pixelSize                 ds.l   1        ; offset: $10 (16)
  387. space                     ds.l   1        ; offset: $14 (20)
  388. user1                     ds.l   1        ; offset: $18 (24)
  389. user2                     ds.l   1        ; offset: $1C (28)
  390. sizeof                     EQU *            ; size:   $20 (32)
  391.                         ENDR
  392.  
  393. ; typedef struct CMBitmap     CMBitmap
  394. ; Classic Print Manager Stuff 
  395.  
  396. enableColorMatchingOp            EQU        12
  397. registerProfileOp                EQU        13
  398.  
  399. ; PrGeneral parameter blocks 
  400. TEnableColorMatchingBlk RECORD    0
  401. iOpCode                     ds.w   1        ; offset: $0 (0)
  402. iError                     ds.w   1        ; offset: $2 (2)
  403. lReserved                 ds.l   1        ; offset: $4 (4)
  404. hPrint                     ds.l   1        ; offset: $8 (8)
  405. fEnableIt                 ds.b   1        ; offset: $C (12)
  406. filler                     ds.b   1        ; offset: $D (13)
  407. sizeof                     EQU *            ; size:   $E (14)
  408.                         ENDR
  409.  
  410. ; typedef struct TEnableColorMatchingBlk  TEnableColorMatchingBlk
  411. TRegisterProfileBlk     RECORD    0
  412. iOpCode                     ds.w   1        ; offset: $0 (0)
  413. iError                     ds.w   1        ; offset: $2 (2)
  414. lReserved                 ds.l   1        ; offset: $4 (4)
  415. hPrint                     ds.l   1        ; offset: $8 (8)
  416. fRegisterIt                 ds.b   1        ; offset: $C (12)
  417. filler                     ds.b   1        ; offset: $D (13)
  418. sizeof                     EQU *            ; size:   $E (14)
  419.                         ENDR
  420.  
  421. ; typedef struct TRegisterProfileBlk  TRegisterProfileBlk
  422.  
  423. cmNoProfileBase                    EQU        0
  424. cmFileBasedProfile                EQU        1
  425. cmHandleBasedProfile            EQU        2
  426. cmPtrBasedProfile                EQU        3
  427.  
  428. CMFileLocation             RECORD    0
  429. spec                     ds     FSSpec    ; offset: $0 (0)
  430. sizeof                     EQU *            ; size:   $46 (70)
  431.                         ENDR
  432.  
  433. ; typedef struct CMFileLocation  CMFileLocation
  434. CMHandleLocation         RECORD    0
  435. h                         ds.l   1        ; offset: $0 (0)
  436. sizeof                     EQU *            ; size:   $4 (4)
  437.                         ENDR
  438.  
  439. ; typedef struct CMHandleLocation  CMHandleLocation
  440. CMPtrLocation             RECORD    0
  441. p                         ds.l   1        ; offset: $0 (0)
  442. sizeof                     EQU *            ; size:   $4 (4)
  443.                         ENDR
  444.  
  445. ; typedef struct CMPtrLocation  CMPtrLocation
  446. CMProfLoc                 RECORD    0
  447. fileLoc                     ds     CMFileLocation ; offset: $0 (0)
  448.                          ORG 0
  449. handleLoc                 ds     CMHandleLocation ; offset: $0 (0)
  450.                          ORG 0
  451. ptrLoc                     ds     CMPtrLocation ; offset: $0 (0)
  452.                          ORG 70
  453. sizeof                     EQU *            ; size:   $46 (70)
  454.                         ENDR
  455.  
  456. ; typedef union CMProfLoc     CMProfLoc
  457. CMProfileLocation         RECORD    0
  458. locType                     ds.w   1        ; offset: $0 (0)
  459. u                         ds.w   35        ; offset: $2 (2)
  460. sizeof                     EQU *            ; size:   $48 (72)
  461.                         ENDR
  462.  
  463. ; typedef struct CMProfileLocation  CMProfileLocation
  464. ; Profile file and element access 
  465. ;
  466. ; pascal CMError CMOpenProfile(CMProfileRef *prof, const CMProfileLocation *theProfile)
  467. ;
  468.     IF ¬ GENERATINGCFM THEN
  469.         Macro
  470.         _CMOpenProfile
  471.             dc.w     $203C
  472.             dc.w     $0008
  473.             dc.w     $001C
  474.             dc.w     $ABEE
  475.         EndM
  476.     ELSE
  477.         IMPORT_CFM_FUNCTION    CMOpenProfile
  478.     ENDIF
  479.  
  480. ;
  481. ; pascal CMError CMCloseProfile(CMProfileRef prof)
  482. ;
  483.     IF ¬ GENERATINGCFM THEN
  484.         Macro
  485.         _CMCloseProfile
  486.             dc.w     $203C
  487.             dc.w     $0004
  488.             dc.w     $001D
  489.             dc.w     $ABEE
  490.         EndM
  491.     ELSE
  492.         IMPORT_CFM_FUNCTION    CMCloseProfile
  493.     ENDIF
  494.  
  495. ;
  496. ; pascal CMError CMUpdateProfile(CMProfileRef prof)
  497. ;
  498.     IF ¬ GENERATINGCFM THEN
  499.         Macro
  500.         _CMUpdateProfile
  501.             dc.w     $203C
  502.             dc.w     $0004
  503.             dc.w     $0034
  504.             dc.w     $ABEE
  505.         EndM
  506.     ELSE
  507.         IMPORT_CFM_FUNCTION    CMUpdateProfile
  508.     ENDIF
  509.  
  510. ;
  511. ; pascal CMError CMNewProfile(CMProfileRef *prof, const CMProfileLocation *theProfile)
  512. ;
  513.     IF ¬ GENERATINGCFM THEN
  514.         Macro
  515.         _CMNewProfile
  516.             dc.w     $203C
  517.             dc.w     $0008
  518.             dc.w     $001B
  519.             dc.w     $ABEE
  520.         EndM
  521.     ELSE
  522.         IMPORT_CFM_FUNCTION    CMNewProfile
  523.     ENDIF
  524.  
  525. ;
  526. ; pascal CMError CMCopyProfile(CMProfileRef *targetProf, const CMProfileLocation *targetLocation, CMProfileRef srcProf)
  527. ;
  528.     IF ¬ GENERATINGCFM THEN
  529.         Macro
  530.         _CMCopyProfile
  531.             dc.w     $203C
  532.             dc.w     $000C
  533.             dc.w     $0025
  534.             dc.w     $ABEE
  535.         EndM
  536.     ELSE
  537.         IMPORT_CFM_FUNCTION    CMCopyProfile
  538.     ENDIF
  539.  
  540. ;
  541. ; pascal CMError CMGetProfileLocation(CMProfileRef prof, CMProfileLocation *theProfile)
  542. ;
  543.     IF ¬ GENERATINGCFM THEN
  544.         Macro
  545.         _CMGetProfileLocation
  546.             dc.w     $203C
  547.             dc.w     $0008
  548.             dc.w     $003C
  549.             dc.w     $ABEE
  550.         EndM
  551.     ELSE
  552.         IMPORT_CFM_FUNCTION    CMGetProfileLocation
  553.     ENDIF
  554.  
  555. ;
  556. ; pascal CMError CMValidateProfile(CMProfileRef prof, Boolean *valid, Boolean *preferredCMMnotfound)
  557. ;
  558.     IF ¬ GENERATINGCFM THEN
  559.         Macro
  560.         _CMValidateProfile
  561.             dc.w     $203C
  562.             dc.w     $000C
  563.             dc.w     $0026
  564.             dc.w     $ABEE
  565.         EndM
  566.     ELSE
  567.         IMPORT_CFM_FUNCTION    CMValidateProfile
  568.     ENDIF
  569.  
  570. ;
  571. ; pascal CMError CMFlattenProfile(CMProfileRef prof, unsigned long flags, CMFlattenUPP proc, void *refCon, Boolean *preferredCMMnotfound)
  572. ;
  573.     IF ¬ GENERATINGCFM THEN
  574.         Macro
  575.         _CMFlattenProfile
  576.             dc.w     $203C
  577.             dc.w     $0014
  578.             dc.w     $0031
  579.             dc.w     $ABEE
  580.         EndM
  581.     ELSE
  582.         IMPORT_CFM_FUNCTION    CMFlattenProfile
  583.     ENDIF
  584.  
  585. ;
  586. ; pascal CMError CMUnflattenProfile(FSSpec *resultFileSpec, CMFlattenUPP proc, void *refCon, Boolean *preferredCMMnotfound)
  587. ;
  588.     IF ¬ GENERATINGCFM THEN
  589.         Macro
  590.         _CMUnflattenProfile
  591.             dc.w     $203C
  592.             dc.w     $0010
  593.             dc.w     $0032
  594.             dc.w     $ABEE
  595.         EndM
  596.     ELSE
  597.         IMPORT_CFM_FUNCTION    CMUnflattenProfile
  598.     ENDIF
  599.  
  600. ;
  601. ; pascal CMError CMProfileElementExists(CMProfileRef prof, OSType tag, Boolean *found)
  602. ;
  603.     IF ¬ GENERATINGCFM THEN
  604.         Macro
  605.         _CMProfileElementExists
  606.             dc.w     $203C
  607.             dc.w     $000C
  608.             dc.w     $001E
  609.             dc.w     $ABEE
  610.         EndM
  611.     ELSE
  612.         IMPORT_CFM_FUNCTION    CMProfileElementExists
  613.     ENDIF
  614.  
  615. ;
  616. ; pascal CMError CMCountProfileElements(CMProfileRef prof, unsigned long *elementCount)
  617. ;
  618.     IF ¬ GENERATINGCFM THEN
  619.         Macro
  620.         _CMCountProfileElements
  621.             dc.w     $203C
  622.             dc.w     $0008
  623.             dc.w     $001F
  624.             dc.w     $ABEE
  625.         EndM
  626.     ELSE
  627.         IMPORT_CFM_FUNCTION    CMCountProfileElements
  628.     ENDIF
  629.  
  630. ;
  631. ; pascal CMError CMGetProfileElement(CMProfileRef prof, OSType tag, unsigned long *elementSize, void *elementData)
  632. ;
  633.     IF ¬ GENERATINGCFM THEN
  634.         Macro
  635.         _CMGetProfileElement
  636.             dc.w     $203C
  637.             dc.w     $0010
  638.             dc.w     $0020
  639.             dc.w     $ABEE
  640.         EndM
  641.     ELSE
  642.         IMPORT_CFM_FUNCTION    CMGetProfileElement
  643.     ENDIF
  644.  
  645. ;
  646. ; pascal CMError CMGetProfileHeader(CMProfileRef prof, CMAppleProfileHeader *header)
  647. ;
  648.     IF ¬ GENERATINGCFM THEN
  649.         Macro
  650.         _CMGetProfileHeader
  651.             dc.w     $203C
  652.             dc.w     $0008
  653.             dc.w     $0039
  654.             dc.w     $ABEE
  655.         EndM
  656.     ELSE
  657.         IMPORT_CFM_FUNCTION    CMGetProfileHeader
  658.     ENDIF
  659.  
  660. ;
  661. ; pascal CMError CMGetPartialProfileElement(CMProfileRef prof, OSType tag, unsigned long offset, unsigned long *byteCount, void *elementData)
  662. ;
  663.     IF ¬ GENERATINGCFM THEN
  664.         Macro
  665.         _CMGetPartialProfileElement
  666.             dc.w     $203C
  667.             dc.w     $0014
  668.             dc.w     $0036
  669.             dc.w     $ABEE
  670.         EndM
  671.     ELSE
  672.         IMPORT_CFM_FUNCTION    CMGetPartialProfileElement
  673.     ENDIF
  674.  
  675. ;
  676. ; pascal CMError CMSetProfileElementSize(CMProfileRef prof, OSType tag, unsigned long elementSize)
  677. ;
  678.     IF ¬ GENERATINGCFM THEN
  679.         Macro
  680.         _CMSetProfileElementSize
  681.             dc.w     $203C
  682.             dc.w     $000C
  683.             dc.w     $0038
  684.             dc.w     $ABEE
  685.         EndM
  686.     ELSE
  687.         IMPORT_CFM_FUNCTION    CMSetProfileElementSize
  688.     ENDIF
  689.  
  690. ;
  691. ; pascal CMError CMSetPartialProfileElement(CMProfileRef prof, OSType tag, unsigned long offset, unsigned long byteCount, void *elementData)
  692. ;
  693.     IF ¬ GENERATINGCFM THEN
  694.         Macro
  695.         _CMSetPartialProfileElement
  696.             dc.w     $203C
  697.             dc.w     $0014
  698.             dc.w     $0037
  699.             dc.w     $ABEE
  700.         EndM
  701.     ELSE
  702.         IMPORT_CFM_FUNCTION    CMSetPartialProfileElement
  703.     ENDIF
  704.  
  705. ;
  706. ; pascal CMError CMGetIndProfileElementInfo(CMProfileRef prof, unsigned long index, OSType *tag, unsigned long *elementSize, Boolean *refs)
  707. ;
  708.     IF ¬ GENERATINGCFM THEN
  709.         Macro
  710.         _CMGetIndProfileElementInfo
  711.             dc.w     $203C
  712.             dc.w     $0014
  713.             dc.w     $0021
  714.             dc.w     $ABEE
  715.         EndM
  716.     ELSE
  717.         IMPORT_CFM_FUNCTION    CMGetIndProfileElementInfo
  718.     ENDIF
  719.  
  720. ;
  721. ; pascal CMError CMGetIndProfileElement(CMProfileRef prof, unsigned long index, unsigned long *elementSize, void *elementData)
  722. ;
  723.     IF ¬ GENERATINGCFM THEN
  724.         Macro
  725.         _CMGetIndProfileElement
  726.             dc.w     $203C
  727.             dc.w     $0010
  728.             dc.w     $0022
  729.             dc.w     $ABEE
  730.         EndM
  731.     ELSE
  732.         IMPORT_CFM_FUNCTION    CMGetIndProfileElement
  733.     ENDIF
  734.  
  735. ;
  736. ; pascal CMError CMSetProfileElement(CMProfileRef prof, OSType tag, unsigned long elementSize, void *elementData)
  737. ;
  738.     IF ¬ GENERATINGCFM THEN
  739.         Macro
  740.         _CMSetProfileElement
  741.             dc.w     $203C
  742.             dc.w     $0010
  743.             dc.w     $0023
  744.             dc.w     $ABEE
  745.         EndM
  746.     ELSE
  747.         IMPORT_CFM_FUNCTION    CMSetProfileElement
  748.     ENDIF
  749.  
  750. ;
  751. ; pascal CMError CMSetProfileHeader(CMProfileRef prof, const CMAppleProfileHeader *header)
  752. ;
  753.     IF ¬ GENERATINGCFM THEN
  754.         Macro
  755.         _CMSetProfileHeader
  756.             dc.w     $203C
  757.             dc.w     $0008
  758.             dc.w     $003A
  759.             dc.w     $ABEE
  760.         EndM
  761.     ELSE
  762.         IMPORT_CFM_FUNCTION    CMSetProfileHeader
  763.     ENDIF
  764.  
  765. ;
  766. ; pascal CMError CMSetProfileElementReference(CMProfileRef prof, OSType elementTag, OSType referenceTag)
  767. ;
  768.     IF ¬ GENERATINGCFM THEN
  769.         Macro
  770.         _CMSetProfileElementReference
  771.             dc.w     $203C
  772.             dc.w     $000C
  773.             dc.w     $0035
  774.             dc.w     $ABEE
  775.         EndM
  776.     ELSE
  777.         IMPORT_CFM_FUNCTION    CMSetProfileElementReference
  778.     ENDIF
  779.  
  780. ;
  781. ; pascal CMError CMRemoveProfileElement(CMProfileRef prof, OSType tag)
  782. ;
  783.     IF ¬ GENERATINGCFM THEN
  784.         Macro
  785.         _CMRemoveProfileElement
  786.             dc.w     $203C
  787.             dc.w     $0008
  788.             dc.w     $0024
  789.             dc.w     $ABEE
  790.         EndM
  791.     ELSE
  792.         IMPORT_CFM_FUNCTION    CMRemoveProfileElement
  793.     ENDIF
  794.  
  795. ;
  796. ; pascal CMError CMGetScriptProfileDescription(CMProfileRef prof, Str255 name, ScriptCode *code)
  797. ;
  798.     IF ¬ GENERATINGCFM THEN
  799.         Macro
  800.         _CMGetScriptProfileDescription
  801.             dc.w     $203C
  802.             dc.w     $000C
  803.             dc.w     $003E
  804.             dc.w     $ABEE
  805.         EndM
  806.     ELSE
  807.         IMPORT_CFM_FUNCTION    CMGetScriptProfileDescription
  808.     ENDIF
  809.  
  810. ; Low-level matching functions 
  811. ;
  812. ; pascal CMError NCWNewColorWorld(CMWorldRef *cw, CMProfileRef src, CMProfileRef dst)
  813. ;
  814.     IF ¬ GENERATINGCFM THEN
  815.         Macro
  816.         _NCWNewColorWorld
  817.             dc.w     $203C
  818.             dc.w     $000C
  819.             dc.w     $0014
  820.             dc.w     $ABEE
  821.         EndM
  822.     ELSE
  823.         IMPORT_CFM_FUNCTION    NCWNewColorWorld
  824.     ENDIF
  825.  
  826. ;
  827. ; pascal CMError CWConcatColorWorld(CMWorldRef *cw, CMConcatProfileSet *profileSet)
  828. ;
  829.     IF ¬ GENERATINGCFM THEN
  830.         Macro
  831.         _CWConcatColorWorld
  832.             dc.w     $203C
  833.             dc.w     $0008
  834.             dc.w     $0015
  835.             dc.w     $ABEE
  836.         EndM
  837.     ELSE
  838.         IMPORT_CFM_FUNCTION    CWConcatColorWorld
  839.     ENDIF
  840.  
  841. ;
  842. ; pascal CMError CWNewLinkProfile(CMProfileRef *prof, const CMProfileLocation *targetLocation, CMConcatProfileSet *profileSet)
  843. ;
  844.     IF ¬ GENERATINGCFM THEN
  845.         Macro
  846.         _CWNewLinkProfile
  847.             dc.w     $203C
  848.             dc.w     $000C
  849.             dc.w     $0033
  850.             dc.w     $ABEE
  851.         EndM
  852.     ELSE
  853.         IMPORT_CFM_FUNCTION    CWNewLinkProfile
  854.     ENDIF
  855.  
  856. ;
  857. ; pascal void CWDisposeColorWorld(CMWorldRef cw)
  858. ;
  859.     IF ¬ GENERATINGCFM THEN
  860.         Macro
  861.         _CWDisposeColorWorld
  862.             dc.w     $203C
  863.             dc.w     $0004
  864.             dc.w     $0001
  865.             dc.w     $ABEE
  866.         EndM
  867.     ELSE
  868.         IMPORT_CFM_FUNCTION    CWDisposeColorWorld
  869.     ENDIF
  870.  
  871. ;
  872. ; pascal CMError CWMatchColors(CMWorldRef cw, CMColor *myColors, unsigned long count)
  873. ;
  874.     IF ¬ GENERATINGCFM THEN
  875.         Macro
  876.         _CWMatchColors
  877.             dc.w     $203C
  878.             dc.w     $000C
  879.             dc.w     $0002
  880.             dc.w     $ABEE
  881.         EndM
  882.     ELSE
  883.         IMPORT_CFM_FUNCTION    CWMatchColors
  884.     ENDIF
  885.  
  886. ;
  887. ; pascal CMError CWCheckColors(CMWorldRef cw, CMColor *myColors, unsigned long count, long *result)
  888. ;
  889.     IF ¬ GENERATINGCFM THEN
  890.         Macro
  891.         _CWCheckColors
  892.             dc.w     $203C
  893.             dc.w     $0010
  894.             dc.w     $0003
  895.             dc.w     $ABEE
  896.         EndM
  897.     ELSE
  898.         IMPORT_CFM_FUNCTION    CWCheckColors
  899.     ENDIF
  900.  
  901. ; Bitmap matching 
  902. ;
  903. ; pascal CMError CWMatchBitmap(CMWorldRef cw, CMBitmap *bitmap, CMBitmapCallBackUPP progressProc, void *refCon, CMBitmap *matchedBitmap)
  904. ;
  905.     IF ¬ GENERATINGCFM THEN
  906.         Macro
  907.         _CWMatchBitmap
  908.             dc.w     $203C
  909.             dc.w     $0010
  910.             dc.w     $002C
  911.             dc.w     $ABEE
  912.         EndM
  913.     ELSE
  914.         IMPORT_CFM_FUNCTION    CWMatchBitmap
  915.     ENDIF
  916.  
  917. ;
  918. ; pascal CMError CWCheckBitmap(CMWorldRef cw, const CMBitmap *bitmap, CMBitmapCallBackUPP progressProc, void *refCon, CMBitmap *resultBitmap)
  919. ;
  920.     IF ¬ GENERATINGCFM THEN
  921.         Macro
  922.         _CWCheckBitmap
  923.             dc.w     $203C
  924.             dc.w     $0014
  925.             dc.w     $002D
  926.             dc.w     $ABEE
  927.         EndM
  928.     ELSE
  929.         IMPORT_CFM_FUNCTION    CWCheckBitmap
  930.     ENDIF
  931.  
  932. ; Quickdraw-specific matching 
  933. ;
  934. ; pascal CMError CWMatchPixMap(CMWorldRef cw, PixMap *myPixMap, CMBitmapCallBackUPP progressProc, void *refCon)
  935. ;
  936.     IF ¬ GENERATINGCFM THEN
  937.         Macro
  938.         _CWMatchPixMap
  939.             dc.w     $203C
  940.             dc.w     $0010
  941.             dc.w     $0004
  942.             dc.w     $ABEE
  943.         EndM
  944.     ELSE
  945.         IMPORT_CFM_FUNCTION    CWMatchPixMap
  946.     ENDIF
  947.  
  948. ;
  949. ; pascal CMError CWCheckPixMap(CMWorldRef cw, PixMap *myPixMap, CMBitmapCallBackUPP progressProc, void *refCon, BitMap *resultBitMap)
  950. ;
  951.     IF ¬ GENERATINGCFM THEN
  952.         Macro
  953.         _CWCheckPixMap
  954.             dc.w     $203C
  955.             dc.w     $0014
  956.             dc.w     $0007
  957.             dc.w     $ABEE
  958.         EndM
  959.     ELSE
  960.         IMPORT_CFM_FUNCTION    CWCheckPixMap
  961.     ENDIF
  962.  
  963. ;
  964. ; pascal CMError NCMBeginMatching(CMProfileRef src, CMProfileRef dst, CMMatchRef *myRef)
  965. ;
  966.     IF ¬ GENERATINGCFM THEN
  967.         Macro
  968.         _NCMBeginMatching
  969.             dc.w     $203C
  970.             dc.w     $000C
  971.             dc.w     $0016
  972.             dc.w     $ABEE
  973.         EndM
  974.     ELSE
  975.         IMPORT_CFM_FUNCTION    NCMBeginMatching
  976.     ENDIF
  977.  
  978. ;
  979. ; pascal void CMEndMatching(CMMatchRef myRef)
  980. ;
  981.     IF ¬ GENERATINGCFM THEN
  982.         Macro
  983.         _CMEndMatching
  984.             dc.w     $203C
  985.             dc.w     $0004
  986.             dc.w     $000B
  987.             dc.w     $ABEE
  988.         EndM
  989.     ELSE
  990.         IMPORT_CFM_FUNCTION    CMEndMatching
  991.     ENDIF
  992.  
  993. ;
  994. ; pascal void NCMDrawMatchedPicture(PicHandle myPicture, CMProfileRef dst, Rect *myRect)
  995. ;
  996.     IF ¬ GENERATINGCFM THEN
  997.         Macro
  998.         _NCMDrawMatchedPicture
  999.             dc.w     $203C
  1000.             dc.w     $000C
  1001.             dc.w     $0017
  1002.             dc.w     $ABEE
  1003.         EndM
  1004.     ELSE
  1005.         IMPORT_CFM_FUNCTION    NCMDrawMatchedPicture
  1006.     ENDIF
  1007.  
  1008. ;
  1009. ; pascal void CMEnableMatchingComment(Boolean enableIt)
  1010. ;
  1011.     IF ¬ GENERATINGCFM THEN
  1012.         Macro
  1013.         _CMEnableMatchingComment
  1014.             dc.w     $203C
  1015.             dc.w     $0002
  1016.             dc.w     $000D
  1017.             dc.w     $ABEE
  1018.         EndM
  1019.     ELSE
  1020.         IMPORT_CFM_FUNCTION    CMEnableMatchingComment
  1021.     ENDIF
  1022.  
  1023. ;
  1024. ; pascal CMError NCMUseProfileComment(CMProfileRef prof, unsigned long flags)
  1025. ;
  1026.     IF ¬ GENERATINGCFM THEN
  1027.         Macro
  1028.         _NCMUseProfileComment
  1029.             dc.w     $203C
  1030.             dc.w     $0008
  1031.             dc.w     $003B
  1032.             dc.w     $ABEE
  1033.         EndM
  1034.     ELSE
  1035.         IMPORT_CFM_FUNCTION    NCMUseProfileComment
  1036.     ENDIF
  1037.  
  1038. ; System Profile access 
  1039. ;
  1040. ; pascal CMError CMGetSystemProfile(CMProfileRef *prof)
  1041. ;
  1042.     IF ¬ GENERATINGCFM THEN
  1043.         Macro
  1044.         _CMGetSystemProfile
  1045.             dc.w     $203C
  1046.             dc.w     $0004
  1047.             dc.w     $0018
  1048.             dc.w     $ABEE
  1049.         EndM
  1050.     ELSE
  1051.         IMPORT_CFM_FUNCTION    CMGetSystemProfile
  1052.     ENDIF
  1053.  
  1054. ;
  1055. ; pascal CMError CMSetSystemProfile(const FSSpec *profileFileSpec)
  1056. ;
  1057.     IF ¬ GENERATINGCFM THEN
  1058.         Macro
  1059.         _CMSetSystemProfile
  1060.             dc.w     $203C
  1061.             dc.w     $0004
  1062.             dc.w     $0019
  1063.             dc.w     $ABEE
  1064.         EndM
  1065.     ELSE
  1066.         IMPORT_CFM_FUNCTION    CMSetSystemProfile
  1067.     ENDIF
  1068.  
  1069. ; External Profile Management 
  1070. ;
  1071. ; pascal CMError CMNewProfileSearch(CMSearchRecord *searchSpec, void *refCon, unsigned long *count, CMProfileSearchRef *searchResult)
  1072. ;
  1073.     IF ¬ GENERATINGCFM THEN
  1074.         Macro
  1075.         _CMNewProfileSearch
  1076.             dc.w     $203C
  1077.             dc.w     $0010
  1078.             dc.w     $0027
  1079.             dc.w     $ABEE
  1080.         EndM
  1081.     ELSE
  1082.         IMPORT_CFM_FUNCTION    CMNewProfileSearch
  1083.     ENDIF
  1084.  
  1085. ;
  1086. ; pascal CMError CMUpdateProfileSearch(CMProfileSearchRef search, void *refCon, unsigned long *count)
  1087. ;
  1088.     IF ¬ GENERATINGCFM THEN
  1089.         Macro
  1090.         _CMUpdateProfileSearch
  1091.             dc.w     $203C
  1092.             dc.w     $000C
  1093.             dc.w     $0028
  1094.             dc.w     $ABEE
  1095.         EndM
  1096.     ELSE
  1097.         IMPORT_CFM_FUNCTION    CMUpdateProfileSearch
  1098.     ENDIF
  1099.  
  1100. ;
  1101. ; pascal void CMDisposeProfileSearch(CMProfileSearchRef search)
  1102. ;
  1103.     IF ¬ GENERATINGCFM THEN
  1104.         Macro
  1105.         _CMDisposeProfileSearch
  1106.             dc.w     $203C
  1107.             dc.w     $0004
  1108.             dc.w     $0029
  1109.             dc.w     $ABEE
  1110.         EndM
  1111.     ELSE
  1112.         IMPORT_CFM_FUNCTION    CMDisposeProfileSearch
  1113.     ENDIF
  1114.  
  1115. ;
  1116. ; pascal CMError CMSearchGetIndProfile(CMProfileSearchRef search, unsigned long index, CMProfileRef *prof)
  1117. ;
  1118.     IF ¬ GENERATINGCFM THEN
  1119.         Macro
  1120.         _CMSearchGetIndProfile
  1121.             dc.w     $203C
  1122.             dc.w     $000C
  1123.             dc.w     $002A
  1124.             dc.w     $ABEE
  1125.         EndM
  1126.     ELSE
  1127.         IMPORT_CFM_FUNCTION    CMSearchGetIndProfile
  1128.     ENDIF
  1129.  
  1130. ;
  1131. ; pascal CMError CMSearchGetIndProfileFileSpec(CMProfileSearchRef search, unsigned long index, FSSpec *profileFile)
  1132. ;
  1133.     IF ¬ GENERATINGCFM THEN
  1134.         Macro
  1135.         _CMSearchGetIndProfileFileSpec
  1136.             dc.w     $203C
  1137.             dc.w     $000C
  1138.             dc.w     $002B
  1139.             dc.w     $ABEE
  1140.         EndM
  1141.     ELSE
  1142.         IMPORT_CFM_FUNCTION    CMSearchGetIndProfileFileSpec
  1143.     ENDIF
  1144.  
  1145. ; Utilities 
  1146. ;
  1147. ; pascal CMError CMGetColorSyncFolderSpec(short vRefNum, Boolean createFolder, short *foundVRefNum, long *foundDirID)
  1148. ;
  1149.     IF ¬ GENERATINGCFM THEN
  1150.         Macro
  1151.         _CMGetColorSyncFolderSpec
  1152.             dc.w     $203C
  1153.             dc.w     $000C
  1154.             dc.w     $0011
  1155.             dc.w     $ABEE
  1156.         EndM
  1157.     ELSE
  1158.         IMPORT_CFM_FUNCTION    CMGetColorSyncFolderSpec
  1159.     ENDIF
  1160.  
  1161. ;
  1162. ; pascal CMError CMGetCWInfo(CMWorldRef cw, CMCWInfoRecord *info)
  1163. ;
  1164.     IF ¬ GENERATINGCFM THEN
  1165.         Macro
  1166.         _CMGetCWInfo
  1167.             dc.w     $203C
  1168.             dc.w     $000C
  1169.             dc.w     $001A
  1170.             dc.w     $ABEE
  1171.         EndM
  1172.     ELSE
  1173.         IMPORT_CFM_FUNCTION    CMGetCWInfo
  1174.     ENDIF
  1175.  
  1176. ; PS-related 
  1177. ;
  1178. ; pascal CMError CMGetPS2ColorSpace(CMProfileRef srcProf, unsigned long flags, CMFlattenUPP proc, void *refCon, Boolean *preferredCMMnotfound)
  1179. ;
  1180.     IF ¬ GENERATINGCFM THEN
  1181.         Macro
  1182.         _CMGetPS2ColorSpace
  1183.             dc.w     $203C
  1184.             dc.w     $0014
  1185.             dc.w     $002E
  1186.             dc.w     $ABEE
  1187.         EndM
  1188.     ELSE
  1189.         IMPORT_CFM_FUNCTION    CMGetPS2ColorSpace
  1190.     ENDIF
  1191.  
  1192. ;
  1193. ; pascal CMError CMGetPS2ColorRenderingIntent(CMProfileRef srcProf, unsigned long flags, CMFlattenUPP proc, void *refCon, Boolean *preferredCMMnotfound)
  1194. ;
  1195.     IF ¬ GENERATINGCFM THEN
  1196.         Macro
  1197.         _CMGetPS2ColorRenderingIntent
  1198.             dc.w     $203C
  1199.             dc.w     $0014
  1200.             dc.w     $002F
  1201.             dc.w     $ABEE
  1202.         EndM
  1203.     ELSE
  1204.         IMPORT_CFM_FUNCTION    CMGetPS2ColorRenderingIntent
  1205.     ENDIF
  1206.  
  1207. ;
  1208. ; pascal CMError CMGetPS2ColorRendering(CMProfileRef srcProf, CMProfileRef dstProf, unsigned long flags, CMFlattenUPP proc, void *refCon, Boolean *preferredCMMnotfound)
  1209. ;
  1210.     IF ¬ GENERATINGCFM THEN
  1211.         Macro
  1212.         _CMGetPS2ColorRendering
  1213.             dc.w     $203C
  1214.             dc.w     $0018
  1215.             dc.w     $0030
  1216.             dc.w     $ABEE
  1217.         EndM
  1218.     ELSE
  1219.         IMPORT_CFM_FUNCTION    CMGetPS2ColorRendering
  1220.     ENDIF
  1221.  
  1222. ;
  1223. ; pascal CMError CMGetPS2ColorRenderingVMSize(CMProfileRef srcProf, CMProfileRef dstProf, unsigned long *vmSize, Boolean *preferredCMMnotfound)
  1224. ;
  1225.     IF ¬ GENERATINGCFM THEN
  1226.         Macro
  1227.         _CMGetPS2ColorRenderingVMSize
  1228.             dc.w     $203C
  1229.             dc.w     $0010
  1230.             dc.w     $003D
  1231.             dc.w     $ABEE
  1232.         EndM
  1233.     ELSE
  1234.         IMPORT_CFM_FUNCTION    CMGetPS2ColorRenderingVMSize
  1235.     ENDIF
  1236.  
  1237. ; ColorSync 1.0 functions which have parallel 2.0 counterparts 
  1238. ;
  1239. ; pascal CMError CWNewColorWorld(CMWorldRef *cw, CMProfileHandle src, CMProfileHandle dst)
  1240. ;
  1241.     IF ¬ GENERATINGCFM THEN
  1242.         Macro
  1243.         _CWNewColorWorld
  1244.             dc.w     $203C
  1245.             dc.w     $000C
  1246.             dc.w     $0000
  1247.             dc.w     $ABEE
  1248.         EndM
  1249.     ELSE
  1250.         IMPORT_CFM_FUNCTION    CWNewColorWorld
  1251.     ENDIF
  1252.  
  1253. ;
  1254. ; pascal CMError ConcatenateProfiles(CMProfileHandle thru, CMProfileHandle dst, CMProfileHandle *newDst)
  1255. ;
  1256.     IF ¬ GENERATINGCFM THEN
  1257.         Macro
  1258.         _ConcatenateProfiles
  1259.             dc.w     $203C
  1260.             dc.w     $000C
  1261.             dc.w     $000C
  1262.             dc.w     $ABEE
  1263.         EndM
  1264.     ELSE
  1265.         IMPORT_CFM_FUNCTION    ConcatenateProfiles
  1266.     ENDIF
  1267.  
  1268. ;
  1269. ; pascal CMError CMBeginMatching(CMProfileHandle src, CMProfileHandle dst, CMMatchRef *myRef)
  1270. ;
  1271.     IF ¬ GENERATINGCFM THEN
  1272.         Macro
  1273.         _CMBeginMatching
  1274.             dc.w     $203C
  1275.             dc.w     $000C
  1276.             dc.w     $000A
  1277.             dc.w     $ABEE
  1278.         EndM
  1279.     ELSE
  1280.         IMPORT_CFM_FUNCTION    CMBeginMatching
  1281.     ENDIF
  1282.  
  1283. ;
  1284. ; pascal void CMDrawMatchedPicture(PicHandle myPicture, CMProfileHandle dst, Rect *myRect)
  1285. ;
  1286.     IF ¬ GENERATINGCFM THEN
  1287.         Macro
  1288.         _CMDrawMatchedPicture
  1289.             dc.w     $203C
  1290.             dc.w     $000C
  1291.             dc.w     $0009
  1292.             dc.w     $ABEE
  1293.         EndM
  1294.     ELSE
  1295.         IMPORT_CFM_FUNCTION    CMDrawMatchedPicture
  1296.     ENDIF
  1297.  
  1298. ;
  1299. ; pascal CMError CMUseProfileComment(CMProfileHandle profile)
  1300. ;
  1301.     IF ¬ GENERATINGCFM THEN
  1302.         Macro
  1303.         _CMUseProfileComment
  1304.             dc.w     $203C
  1305.             dc.w     $0004
  1306.             dc.w     $0008
  1307.             dc.w     $ABEE
  1308.         EndM
  1309.     ELSE
  1310.         IMPORT_CFM_FUNCTION    CMUseProfileComment
  1311.     ENDIF
  1312.  
  1313. ;
  1314. ; pascal void CMGetProfileName(CMProfileHandle myProfile, CMIString *IStringResult)
  1315. ;
  1316.     IF ¬ GENERATINGCFM THEN
  1317.         Macro
  1318.         _CMGetProfileName
  1319.             dc.w     $203C
  1320.             dc.w     $0008
  1321.             dc.w     $000E
  1322.             dc.w     $ABEE
  1323.         EndM
  1324.     ELSE
  1325.         IMPORT_CFM_FUNCTION    CMGetProfileName
  1326.     ENDIF
  1327.  
  1328. ;
  1329. ; pascal long CMGetProfileAdditionalDataOffset(CMProfileHandle myProfile)
  1330. ;
  1331.     IF ¬ GENERATINGCFM THEN
  1332.         Macro
  1333.         _CMGetProfileAdditionalDataOffset
  1334.             dc.w     $203C
  1335.             dc.w     $0004
  1336.             dc.w     $000F
  1337.             dc.w     $ABEE
  1338.         EndM
  1339.     ELSE
  1340.         IMPORT_CFM_FUNCTION    CMGetProfileAdditionalDataOffset
  1341.     ENDIF
  1342.  
  1343. ; ProfileResponder functions 
  1344. ;
  1345. ; pascal CMError GetProfile(OSType deviceType, long refNum, CMProfileHandle aProfile, CMProfileHandle *returnedProfile)
  1346. ;
  1347.     IF ¬ GENERATINGCFM THEN
  1348.         Macro
  1349.         _GetProfile
  1350.             dc.w     $203C
  1351.             dc.w     $0010
  1352.             dc.w     $0005
  1353.             dc.w     $ABEE
  1354.         EndM
  1355.     ELSE
  1356.         IMPORT_CFM_FUNCTION    GetProfile
  1357.     ENDIF
  1358.  
  1359. ;
  1360. ; pascal CMError SetProfile(OSType deviceType, long refNum, CMProfileHandle newProfile)
  1361. ;
  1362.     IF ¬ GENERATINGCFM THEN
  1363.         Macro
  1364.         _SetProfile
  1365.             dc.w     $203C
  1366.             dc.w     $000C
  1367.             dc.w     $0006
  1368.             dc.w     $ABEE
  1369.         EndM
  1370.     ELSE
  1371.         IMPORT_CFM_FUNCTION    SetProfile
  1372.     ENDIF
  1373.  
  1374. ;
  1375. ; pascal CMError SetProfileDescription(OSType deviceType, long refNum, long deviceData, CMProfileHandle hProfile)
  1376. ;
  1377.     IF ¬ GENERATINGCFM THEN
  1378.         Macro
  1379.         _SetProfileDescription
  1380.             dc.w     $203C
  1381.             dc.w     $0010
  1382.             dc.w     $0010
  1383.             dc.w     $ABEE
  1384.         EndM
  1385.     ELSE
  1386.         IMPORT_CFM_FUNCTION    SetProfileDescription
  1387.     ENDIF
  1388.  
  1389. ;
  1390. ; pascal CMError GetIndexedProfile(OSType deviceType, long refNum, CMProfileSearchRecordHandle search, CMProfileHandle *returnProfile, long *index)
  1391. ;
  1392.     IF ¬ GENERATINGCFM THEN
  1393.         Macro
  1394.         _GetIndexedProfile
  1395.             dc.w     $203C
  1396.             dc.w     $0014
  1397.             dc.w     $0012
  1398.             dc.w     $ABEE
  1399.         EndM
  1400.     ELSE
  1401.         IMPORT_CFM_FUNCTION    GetIndexedProfile
  1402.     ENDIF
  1403.  
  1404. ;
  1405. ; pascal CMError DeleteDeviceProfile(OSType deviceType, long refNum, CMProfileHandle deleteMe)
  1406. ;
  1407.     IF ¬ GENERATINGCFM THEN
  1408.         Macro
  1409.         _DeleteDeviceProfile
  1410.             dc.w     $203C
  1411.             dc.w     $000C
  1412.             dc.w     $0013
  1413.             dc.w     $ABEE
  1414.         EndM
  1415.     ELSE
  1416.         IMPORT_CFM_FUNCTION    DeleteDeviceProfile
  1417.     ENDIF
  1418.  
  1419.     IF OLDROUTINENAMES  THEN
  1420.  
  1421. kMatchCMMType                    EQU        cmMatchCMMType
  1422. kMatchApplProfileVersion        EQU        cmMatchApplProfileVersion
  1423. kMatchDataType                    EQU        cmMatchDataType
  1424. kMatchDeviceType                EQU        cmMatchDeviceType
  1425. kMatchDeviceManufacturer        EQU        cmMatchDeviceManufacturer
  1426. kMatchDeviceModel                EQU        cmMatchDeviceModel
  1427. kMatchDeviceAttributes            EQU        cmMatchDeviceAttributes
  1428. kMatchFlags                        EQU        cmMatchFlags
  1429. kMatchOptions                    EQU        cmMatchOptions
  1430. kMatchWhite                        EQU        cmMatchWhite
  1431. kMatchBlack                        EQU        cmMatchBlack
  1432.  
  1433. ; types 
  1434. ; typedef struct CMCMYKColor  CMYKColor
  1435. ; typedef CMWorldRef         CWorld
  1436. ; typedef long                 *CMGamutResult
  1437. ; functions 
  1438. ;
  1439. ; pascal void EndMatching(CMMatchRef myRef)
  1440. ;
  1441.     IF ¬ GENERATINGCFM THEN
  1442.         Macro
  1443.         _EndMatching
  1444.             dc.w     $203C
  1445.             dc.w     $0004
  1446.             dc.w     $000B
  1447.             dc.w     $ABEE
  1448.         EndM
  1449.     ELSE
  1450.         IMPORT_CFM_FUNCTION    EndMatching
  1451.     ENDIF
  1452.  
  1453. ;
  1454. ; pascal void EnableMatching(Boolean enableIt)
  1455. ;
  1456.     IF ¬ GENERATINGCFM THEN
  1457.         Macro
  1458.         _EnableMatching
  1459.             dc.w     $203C
  1460.             dc.w     $0002
  1461.             dc.w     $000D
  1462.             dc.w     $ABEE
  1463.         EndM
  1464.     ELSE
  1465.         IMPORT_CFM_FUNCTION    EnableMatching
  1466.     ENDIF
  1467.  
  1468. ;
  1469. ; pascal CMError GetColorSyncFolderSpec(short vRefNum, Boolean createFolder, short *foundVRefNum, long *foundDirID)
  1470. ;
  1471.     IF ¬ GENERATINGCFM THEN
  1472.         Macro
  1473.         _GetColorSyncFolderSpec
  1474.             dc.w     $203C
  1475.             dc.w     $000C
  1476.             dc.w     $0011
  1477.             dc.w     $ABEE
  1478.         EndM
  1479.     ELSE
  1480.         IMPORT_CFM_FUNCTION    GetColorSyncFolderSpec
  1481.     ENDIF
  1482.  
  1483. ;
  1484. ; pascal CMError BeginMatching(CMProfileHandle src, CMProfileHandle dst, CMMatchRef *myRef)
  1485. ;
  1486.     IF ¬ GENERATINGCFM THEN
  1487.         Macro
  1488.         _BeginMatching
  1489.             dc.w     $203C
  1490.             dc.w     $000C
  1491.             dc.w     $000A
  1492.             dc.w     $ABEE
  1493.         EndM
  1494.     ELSE
  1495.         IMPORT_CFM_FUNCTION    BeginMatching
  1496.     ENDIF
  1497.  
  1498. ;
  1499. ; pascal void DrawMatchedPicture(PicHandle myPicture, CMProfileHandle dst, Rect *myRect)
  1500. ;
  1501.     IF ¬ GENERATINGCFM THEN
  1502.         Macro
  1503.         _DrawMatchedPicture
  1504.             dc.w     $203C
  1505.             dc.w     $000C
  1506.             dc.w     $0009
  1507.             dc.w     $ABEE
  1508.         EndM
  1509.     ELSE
  1510.         IMPORT_CFM_FUNCTION    DrawMatchedPicture
  1511.     ENDIF
  1512.  
  1513. ;
  1514. ; pascal CMError UseProfile(CMProfileHandle profile)
  1515. ;
  1516.     IF ¬ GENERATINGCFM THEN
  1517.         Macro
  1518.         _UseProfile
  1519.             dc.w     $203C
  1520.             dc.w     $0004
  1521.             dc.w     $0008
  1522.             dc.w     $ABEE
  1523.         EndM
  1524.     ELSE
  1525.         IMPORT_CFM_FUNCTION    UseProfile
  1526.     ENDIF
  1527.  
  1528. ;
  1529. ; pascal void GetProfileName(CMProfileHandle myProfile, CMIString *IStringResult)
  1530. ;
  1531.     IF ¬ GENERATINGCFM THEN
  1532.         Macro
  1533.         _GetProfileName
  1534.             dc.w     $203C
  1535.             dc.w     $0008
  1536.             dc.w     $000E
  1537.             dc.w     $ABEE
  1538.         EndM
  1539.     ELSE
  1540.         IMPORT_CFM_FUNCTION    GetProfileName
  1541.     ENDIF
  1542.  
  1543. ;
  1544. ; pascal long GetProfileAdditionalDataOffset(CMProfileHandle myProfile)
  1545. ;
  1546.     IF ¬ GENERATINGCFM THEN
  1547.         Macro
  1548.         _GetProfileAdditionalDataOffset
  1549.             dc.w     $203C
  1550.             dc.w     $0004
  1551.             dc.w     $000F
  1552.             dc.w     $ABEE
  1553.         EndM
  1554.     ELSE
  1555.         IMPORT_CFM_FUNCTION    GetProfileAdditionalDataOffset
  1556.     ENDIF
  1557.  
  1558.     ENDIF
  1559.     ENDIF ; __CMAPPLICATION__
  1560.